<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<t:base type="jquery,easyui,tools,DatePicker,autocomplete"></t:base>
<div class="easyui-layout" fit="true">

    <div region="center" style="padding:0px;border:0px">
        <t:datagrid  name="mainlist" pagination="false" fitColumns="false" title="" onLoadSuccess="doload"  onClick="onselect"  actionUrl="scsjxController.do?mlistDatagrid" idField="id" fit="true" queryMode="group">
            <t:dgCol title="id"  field="id"   hidden="true"   queryMode="group"  width="120"></t:dgCol>
            <t:dgCol title="系统名称"  field="fd_name"    width="120"></t:dgCol>
            <t:dgCol title="矿区名称"    field="fd_kq"  width="120"></t:dgCol>
            <t:dgCol title="数据源"    field="fd_sjlymc" width="80"></t:dgCol>
            <t:dgCol title="类型"    field="fd_lx" colspan="6" width="120"></t:dgCol>
            <t:dgCol title="备注"    field="fd_sm" colspan="6" width="120"></t:dgCol>
            <t:dgCol title="操作" field="opt" width="60"></t:dgCol>
            <t:dgDelOpt title="删除" url="scsjxController.do?dodel&id={id}" urlclass="ace_button"  urlfont="fa-trash-o"/>

            <t:dgToolBar title="录入" icon="icon-add" url="scsjxController.do?edit" funname="add" width="700" height="400"></t:dgToolBar>
            <t:dgToolBar title="编辑" icon="icon-edit" url="scsjxController.do?edit" funname="update" width="700"></t:dgToolBar>
<%--
            <t:dgCol title="生日"  field="birthday" formatter="yyyy-MM-dd"   queryMode="group"  width="120"></t:dgCol>
            <t:dgCol title="部门"  field="depId" query="true" queryMode="single" dictionary="t_s_depart,id,departname"  width="120"></t:dgCol>
            <t:dgCol title="性别"  field="sex"  query="true" dictionary="sex" width="120"></t:dgCol>
            <t:dgCol title="电话"  field="phone" queryMode="group"  width="120"></t:dgCol>
            <t:dgCol title="工资"  field="salary"  queryMode="group"  width="120"></t:dgCol>
            <t:dgCol title="创建日期"  field="createDate" formatter="yyyy-MM-dd" query="false" queryMode="group" editor="datebox" width="120"></t:dgCol>
            <t:dgCol title="邮箱"  field="email"  hidden="true"  queryMode="group"  width="120"></t:dgCol>
            <t:dgCol title="入职状态"  field="status" query="true"   dictionary="sf_yn" width="120"></t:dgCol>
            <t:dgCol title="个人介绍"  field="content"  hidden="true"   queryMode="group"  width="500"></t:dgCol>--%>
        </t:datagrid>
    </div>
</div>
<script type="text/javascript">
function onselect(rowData) {

    var selected = $('#mainlist').datagrid('getSelected');
    window.parent.onetableid = selected.id;
    window.parent.suber.location.replace("<%=request.getContextPath()%>/scsjxController.do?subtitle&keyid="+window.parent.onetableid+"&pno="+window.parent.pageSelected);

/*
    window.parent.onetableid = selected.id;
    window.parent.rowIndex   = rowIndex;
    if(window.parent.pageSelected==0){
        window.parent.suber.location.replace("/fwq/scrwglController.do?twotitle&keyid="+window.parent.onetableid+"&pageno="+window.parent.pageSelected);
    };*/
}

function doload(rowData){
    var selected = $('#mainlist').datagrid('getSelected');
    if(selected) {
        var ntotlength = rowData.rows.length;
        if(ntotlength < 1) {
            window.parent.suber.location.replace("<%=request.getContextPath()%>/webpage/common/Blank.jsp");
            window.parent.onetableid = "";
        }
    } else {
        var ntotlength = rowData.rows.length;
        if(ntotlength > 0) {
            $('#mainlist').datagrid('selectRow',0);
            var selected = $('#mainlist').datagrid('getSelected');

            window.parent.onetableid = selected.id;
            window.parent.rowIndex   = 0;
            var urls="<%=request.getContextPath()%>/scsjxController.do?subtitle&keyid="+window.parent.onetableid+"&pno="+window.parent.pageSelected

            window.parent.suber.location.replace(urls);

       } else {
            window.parent.suber.location.replace("<%=request.getContextPath()%>/webpage/common/Blank.jsp");
            window.parent.onetableid = "";

        }
    }



}
</script>